const express = require('express');
const router = express.Router();
const login = require("../src/controller/login-controller")
const {home} = require("../src/controller/home-controller")
const auth = require("../src/permission/permission")

// 登录注册
router.get('/action/login.html',login.toLoginPage);
router.post('/action/login.do',login.login);
router.get('/action/logout.do',login.logout);

// 主頁
router.get('/home/home.html',home.toHomePage);
// 未找到路由
router.use((req, res) => {
    res.render('error',{message:"找不到頁面",status:404,stack:404});
});


module.exports = router;
